package com.ruoyi.email.service.impl;

import java.util.List;

import com.ruoyi.email.domain.TmdEmailWrite;
import com.ruoyi.email.vo.TmdEmailRubbishAndWrite;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.email.mapper.TmdEmailRubbishMapper;
import com.ruoyi.email.domain.TmdEmailRubbish;
import com.ruoyi.email.service.ITmdEmailRubbishService;
import com.ruoyi.common.core.text.Convert;

/**
 * 垃圾箱Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-20
 */
@Service
public class TmdEmailRubbishServiceImpl implements ITmdEmailRubbishService 
{
    @Autowired
    private TmdEmailRubbishMapper tmdEmailRubbishMapper;

    /**
     * 查询垃圾箱
     * 
     * @param id 垃圾箱主键
     * @return 垃圾箱
     */
    @Override
    public TmdEmailRubbishAndWrite selectTmdEmailRubbishById(int id)
    {
        return tmdEmailRubbishMapper.selectTmdEmailRubbishById(id);
    }

    /**
     * 查询垃圾箱列表
     * 
     * @param tmdEmailRubbish 垃圾箱
     * @return 垃圾箱
     */
    @Override
    public List<TmdEmailRubbishAndWrite> selectTmdEmailRubbishList(TmdEmailWrite tmdEmailWrite)
    {
        return tmdEmailRubbishMapper.selectTmdEmailRubbishList(tmdEmailWrite);
    }

    /**
     * 新增垃圾箱
     * 
     * @param tmdEmailRubbish 垃圾箱
     * @return 结果
     */
    @Override
    public int insertTmdEmailRubbish(TmdEmailRubbish tmdEmailRubbish)
    {
        return tmdEmailRubbishMapper.insertTmdEmailRubbish(tmdEmailRubbish);
    }

    /**
     * 修改垃圾箱
     * 
     * @param tmdEmailRubbish 垃圾箱
     * @return 结果
     */
    @Override
    public int updateTmdEmailRubbish(TmdEmailRubbish tmdEmailRubbish)
    {
        return tmdEmailRubbishMapper.updateTmdEmailRubbish(tmdEmailRubbish);
    }

    /**
     * 批量删除垃圾箱
     * 
     * @param ids 需要删除的垃圾箱主键
     * @return 结果
     */
    @Override
    public int deleteTmdEmailRubbishByIds(String ids)
    {
        return tmdEmailRubbishMapper.deleteTmdEmailRubbishByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除垃圾箱信息
     * 
     * @param id 垃圾箱主键
     * @return 结果
     */
    @Override
    public int deleteTmdEmailRubbishById(int id)
    {
        return tmdEmailRubbishMapper.deleteTmdEmailRubbishById(id);
    }
}
